#include "widget.h"
#include "ui_widget.h"

#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 账号
    ui->lineEdit->setPlaceholderText("请输入姓名");
    ui->lineEdit->setClearButtonEnabled(true);
    // 密码
    ui->lineEdit_2->setPlaceholderText("请输入密码");
    ui->lineEdit_2->setClearButtonEnabled(true);
    ui->lineEdit_2->setEchoMode(QLineEdit::Password);
    // 电话
    ui->lineEdit_3->setPlaceholderText("请输入电话");
    ui->lineEdit_3->setClearButtonEnabled(true);
    ui->lineEdit_3->setInputMask("000-0000-0000");
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    QString gender = ui->radioButton->isChecked() ? "男" : "女";
    qDebug() << "姓名：" << ui->lineEdit->text()
             << "密码：" << ui->lineEdit_2->text()
             << "性别：" << gender
             << "手机：" << ui->lineEdit_3->text();
}
